1 <?php
2 session_start();
// Use session variable on this page. This function must put on the top of page.
3 if
(!isset($_SESSION['username']) || $_SESSION['usertype'] !='admin'){ // if session variable "username" does not exist.
4 header(
"location:index.php?msg=Please%20login%20to%20access%20admin%20area%20!"); // Re-direct to index.php
5 }

6 else

7 {
8     include_once
"db.php";
9     error_reporting (E_ALL ^ E_NOTICE);
10     
if(isset($_GET['sid']))
11     {
12 ?><!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
13 <html xmlns=
"http://www.w3.org/1999/xhtml">
14 <head>
15 <meta http-equiv=
"Content-Type" content="text/html; charset=iso-8859-1" />
16 <title>Sales Print</title>
17 <style type=
"text/css" media="print">
18 .hide{display:none}
19
20 </style>
21 <script type=
"text/javascript">
22 function printpage() {
23 document.getElementById(
'printButton').style.visibility="hidden";
24 window.print();
25 document.getElementById(
'printButton').style.visibility="visible";
26 }
27 </script>
28 </head>
29
30 <body>
31 <input name=
"print" type="button" value="Print" id="printButton" onClick="printpage()">
32 <table width=
"100%" border="0" cellspacing="0" cellpadding="0">
33   <tr>
34     <td align=
"center" valign="top">
35     
36     <table width=
"595" cellspacing="0" cellpadding="0" id="bordertable" border="1">
37       <tr>
38         <td align=
"center"><strong>Payment Receipt <br />
39         </strong>
40           <table width=
"100%" border="0" cellspacing="0" cellpadding="0">
41             <tr>
42               <td width=
"67%" align="left" valign="top">&nbsp;&nbsp;&nbsp;Date: <?php
43               $sid=$_GET[
'sid'];
44             $line = $db->queryUniqueObject(
"SELECT * FROM transactions WHERE id='$sid' ");
45             
46             $mysqldate=$line->date;
47
48         $phpdate = strtotime( $mysqldate );
49
50         $phpdate = date(
"d/m/Y",$phpdate);
51         echo $phpdate;
52               ?> <br />
53                 <br />
54                 <strong><br />
55                 &nbsp;&nbsp;&nbsp;Receipt No: <?php echo $line->receiptid;
56                 
57                  ?> </strong><br /></td>
58               <td width=
"33%">Murugan Company<br />
59                 address<br />
60                 chennai<br />
61                 Phone</td>
62             </tr>
63           </table></td>
64       </tr>
65       <tr>
66         <td height=
"90" align="left" valign="top"><br />
67           <table width=
"100%" border="0" cellspacing="0" cellpadding="0">
68             <tr>
69               <td width=
"5%" align="left" valign="top"><strong>&nbsp;&nbsp;TO:</strong></td>
70               <td width=
"95%" align="left" valign="top"><br />
71               <?php
72                 echo $line->customer;
73                 $cname=$line->customer_id;
74                 
75                 $line2 = $db->queryUniqueObject(
"SELECT * FROM customer_details WHERE customer_name='$cname' ");
76                 
77                 echo $line2->customer_address;
78                 ?>
79                 <br />
80                 <?php
81                 echo
"Contact1: ".$line2->customer_contact1."<br>";
82                 echo
"Contact1: ".$line2->customer_contact2."<br>";
83                     
84                 
85                 ?></td>
86             </tr>
87           </table></td>
88       </tr>
89       <tr>
90         <td align=
"right"><table width="100%" border="0" cellspacing="0" cellpadding="0">
91           <tr>
92             <td width=
"33%" align="left" valign="top"> </td>
93             <td width=
"67%" align="left"><br />
94             <br />
95               <strong>&nbsp;&nbsp;Paid Amount :&nbsp;&nbsp;<?php echo $line->payment; ?><br />
96               &nbsp;&nbsp;Balance &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;:&nbsp;&nbsp;<?php echo $line->balance; ?><br />
97               &nbsp;&nbsp;Due Date&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;:
98               
99               <?php
100               $bal=$line->balance;
101               
if( $bal!= 0) {
102               
103               $mysqldate=$line->due;
104
105         $phpdate = strtotime( $mysqldate );
106
107         $phpdate = date(
"d/m/Y",$phpdate);
108         echo $phpdate;
109         }
110         
else
111         echo
"NONE";
112         ?> <br />
113               </strong>
114               <br />
115              <br /> &nbsp;&nbsp;&nbsp;&nbsp;</td>
116           </tr>
117           <tr>
118             <td height=
"100" align="left" valign="top">&nbsp;</td>
119             <td height=
"100" align="right" valign="bottom">Signature&nbsp;</td>
120           </tr>
121         </table></td>
122       </tr>
123       <tr>
124         <td align=
"center" bgcolor="#CCCCCC">Thank you for Business with Us </td>
125       </tr>
126     </table></td>
127   </tr>
128 </table>
129
130
131 </body>
132 </html>
133 <?php
134 }

135 else
"Error in processing printing the Payment receipt";
136 }
137 ?>


Gõ tìm kiếm nhanh...